var e = require;
var t = module;
var o = exports;
Object.defineProperty(o, "__esModule", {value: !0}), (o.Md5 = void 0);
var n = (function () {
    function e() {
        (this._state = new Int32Array(4)),
            (this._buffer = new ArrayBuffer(68)),
            (this._buffer8 = new Uint8Array(this._buffer, 0, 68)),
            (this._buffer32 = new Uint32Array(this._buffer, 0, 17)),
            this.start();
    }
    return (
        (e.hashStr = function (e, t) {
            return void 0 === t && (t = !1), this.onePassHasher.start().appendStr(e).end(t);
        }),
        (e.hashAsciiStr = function (e, t) {
            return void 0 === t && (t = !1), this.onePassHasher.start().appendAsciiStr(e).end(t);
        }),
        (e._hex = function (t) {
            var o,
                n,
                a,
                i,
                r = e.hexChars,
                s = e.hexOut;
            for (i = 0; i < 4; i += 1)
                for (n = 8 * i, o = t[i], a = 0; a < 8; a += 2)
                    (s[n + 1 + a] = r.charAt(15 & o)), (o >>>= 4), (s[n + 0 + a] = r.charAt(15 & o)), (o >>>= 4);
            return s.join("");
        }),
        (e._md5cycle = function (e, t) {
            var o = e[0],
                n = e[1],
                a = e[2],
                i = e[3];
            (n =
                ((((n +=
                    ((((a =
                        ((((a +=
                            ((((i =
                                ((((i +=
                                    ((((o =
                                        ((((o += (((n & a) | (~n & i)) + t[0] - 680876936) | 0) << 7) | (o >>> 25)) +
                                            n) |
                                        0) &
                                        n) |
                                        (~o & a)) +
                                        t[1] -
                                        389564586) |
                                    0) <<
                                    12) |
                                    (i >>> 20)) +
                                    o) |
                                0) &
                                o) |
                                (~i & n)) +
                                t[2] +
                                606105819) |
                            0) <<
                            17) |
                            (a >>> 15)) +
                            i) |
                        0) &
                        i) |
                        (~a & o)) +
                        t[3] -
                        1044525330) |
                    0) <<
                    22) |
                    (n >>> 10)) +
                    a) |
                0),
                (n =
                    ((((n +=
                        ((((a =
                            ((((a +=
                                ((((i =
                                    ((((i +=
                                        ((((o =
                                            ((((o += (((n & a) | (~n & i)) + t[4] - 176418897) | 0) << 7) |
                                                (o >>> 25)) +
                                                n) |
                                            0) &
                                            n) |
                                            (~o & a)) +
                                            t[5] +
                                            1200080426) |
                                        0) <<
                                        12) |
                                        (i >>> 20)) +
                                        o) |
                                    0) &
                                    o) |
                                    (~i & n)) +
                                    t[6] -
                                    1473231341) |
                                0) <<
                                17) |
                                (a >>> 15)) +
                                i) |
                            0) &
                            i) |
                            (~a & o)) +
                            t[7] -
                            45705983) |
                        0) <<
                        22) |
                        (n >>> 10)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        ((((a =
                            ((((a +=
                                ((((i =
                                    ((((i +=
                                        ((((o =
                                            ((((o += (((n & a) | (~n & i)) + t[8] + 1770035416) | 0) << 7) |
                                                (o >>> 25)) +
                                                n) |
                                            0) &
                                            n) |
                                            (~o & a)) +
                                            t[9] -
                                            1958414417) |
                                        0) <<
                                        12) |
                                        (i >>> 20)) +
                                        o) |
                                    0) &
                                    o) |
                                    (~i & n)) +
                                    t[10] -
                                    42063) |
                                0) <<
                                17) |
                                (a >>> 15)) +
                                i) |
                            0) &
                            i) |
                            (~a & o)) +
                            t[11] -
                            1990404162) |
                        0) <<
                        22) |
                        (n >>> 10)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        ((((a =
                            ((((a +=
                                ((((i =
                                    ((((i +=
                                        ((((o =
                                            ((((o += (((n & a) | (~n & i)) + t[12] + 1804603682) | 0) << 7) |
                                                (o >>> 25)) +
                                                n) |
                                            0) &
                                            n) |
                                            (~o & a)) +
                                            t[13] -
                                            40341101) |
                                        0) <<
                                        12) |
                                        (i >>> 20)) +
                                        o) |
                                    0) &
                                    o) |
                                    (~i & n)) +
                                    t[14] -
                                    1502002290) |
                                0) <<
                                17) |
                                (a >>> 15)) +
                                i) |
                            0) &
                            i) |
                            (~a & o)) +
                            t[15] +
                            1236535329) |
                        0) <<
                        22) |
                        (n >>> 10)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        ((((a =
                            ((((a +=
                                ((((i =
                                    ((((i +=
                                        ((((o =
                                            ((((o += (((n & i) | (a & ~i)) + t[1] - 165796510) | 0) << 5) |
                                                (o >>> 27)) +
                                                n) |
                                            0) &
                                            a) |
                                            (n & ~a)) +
                                            t[6] -
                                            1069501632) |
                                        0) <<
                                        9) |
                                        (i >>> 23)) +
                                        o) |
                                    0) &
                                    n) |
                                    (o & ~n)) +
                                    t[11] +
                                    643717713) |
                                0) <<
                                14) |
                                (a >>> 18)) +
                                i) |
                            0) &
                            o) |
                            (i & ~o)) +
                            t[0] -
                            373897302) |
                        0) <<
                        20) |
                        (n >>> 12)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        ((((a =
                            ((((a +=
                                ((((i =
                                    ((((i +=
                                        ((((o =
                                            ((((o += (((n & i) | (a & ~i)) + t[5] - 701558691) | 0) << 5) |
                                                (o >>> 27)) +
                                                n) |
                                            0) &
                                            a) |
                                            (n & ~a)) +
                                            t[10] +
                                            38016083) |
                                        0) <<
                                        9) |
                                        (i >>> 23)) +
                                        o) |
                                    0) &
                                    n) |
                                    (o & ~n)) +
                                    t[15] -
                                    660478335) |
                                0) <<
                                14) |
                                (a >>> 18)) +
                                i) |
                            0) &
                            o) |
                            (i & ~o)) +
                            t[4] -
                            405537848) |
                        0) <<
                        20) |
                        (n >>> 12)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        ((((a =
                            ((((a +=
                                ((((i =
                                    ((((i +=
                                        ((((o =
                                            ((((o += (((n & i) | (a & ~i)) + t[9] + 568446438) | 0) << 5) |
                                                (o >>> 27)) +
                                                n) |
                                            0) &
                                            a) |
                                            (n & ~a)) +
                                            t[14] -
                                            1019803690) |
                                        0) <<
                                        9) |
                                        (i >>> 23)) +
                                        o) |
                                    0) &
                                    n) |
                                    (o & ~n)) +
                                    t[3] -
                                    187363961) |
                                0) <<
                                14) |
                                (a >>> 18)) +
                                i) |
                            0) &
                            o) |
                            (i & ~o)) +
                            t[8] +
                            1163531501) |
                        0) <<
                        20) |
                        (n >>> 12)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        ((((a =
                            ((((a +=
                                ((((i =
                                    ((((i +=
                                        ((((o =
                                            ((((o += (((n & i) | (a & ~i)) + t[13] - 1444681467) | 0) << 5) |
                                                (o >>> 27)) +
                                                n) |
                                            0) &
                                            a) |
                                            (n & ~a)) +
                                            t[2] -
                                            51403784) |
                                        0) <<
                                        9) |
                                        (i >>> 23)) +
                                        o) |
                                    0) &
                                    n) |
                                    (o & ~n)) +
                                    t[7] +
                                    1735328473) |
                                0) <<
                                14) |
                                (a >>> 18)) +
                                i) |
                            0) &
                            o) |
                            (i & ~o)) +
                            t[12] -
                            1926607734) |
                        0) <<
                        20) |
                        (n >>> 12)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        (((a =
                            ((((a +=
                                (((i =
                                    ((((i +=
                                        (((o =
                                            ((((o += ((n ^ a ^ i) + t[5] - 378558) | 0) << 4) | (o >>> 28)) + n) | 0) ^
                                            n ^
                                            a) +
                                            t[8] -
                                            2022574463) |
                                        0) <<
                                        11) |
                                        (i >>> 21)) +
                                        o) |
                                    0) ^
                                    o ^
                                    n) +
                                    t[11] +
                                    1839030562) |
                                0) <<
                                16) |
                                (a >>> 16)) +
                                i) |
                            0) ^
                            i ^
                            o) +
                            t[14] -
                            35309556) |
                        0) <<
                        23) |
                        (n >>> 9)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        (((a =
                            ((((a +=
                                (((i =
                                    ((((i +=
                                        (((o =
                                            ((((o += ((n ^ a ^ i) + t[1] - 1530992060) | 0) << 4) | (o >>> 28)) + n) |
                                            0) ^
                                            n ^
                                            a) +
                                            t[4] +
                                            1272893353) |
                                        0) <<
                                        11) |
                                        (i >>> 21)) +
                                        o) |
                                    0) ^
                                    o ^
                                    n) +
                                    t[7] -
                                    155497632) |
                                0) <<
                                16) |
                                (a >>> 16)) +
                                i) |
                            0) ^
                            i ^
                            o) +
                            t[10] -
                            1094730640) |
                        0) <<
                        23) |
                        (n >>> 9)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        (((a =
                            ((((a +=
                                (((i =
                                    ((((i +=
                                        (((o =
                                            ((((o += ((n ^ a ^ i) + t[13] + 681279174) | 0) << 4) | (o >>> 28)) + n) |
                                            0) ^
                                            n ^
                                            a) +
                                            t[0] -
                                            358537222) |
                                        0) <<
                                        11) |
                                        (i >>> 21)) +
                                        o) |
                                    0) ^
                                    o ^
                                    n) +
                                    t[3] -
                                    722521979) |
                                0) <<
                                16) |
                                (a >>> 16)) +
                                i) |
                            0) ^
                            i ^
                            o) +
                            t[6] +
                            76029189) |
                        0) <<
                        23) |
                        (n >>> 9)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        (((a =
                            ((((a +=
                                (((i =
                                    ((((i +=
                                        (((o =
                                            ((((o += ((n ^ a ^ i) + t[9] - 640364487) | 0) << 4) | (o >>> 28)) + n) |
                                            0) ^
                                            n ^
                                            a) +
                                            t[12] -
                                            421815835) |
                                        0) <<
                                        11) |
                                        (i >>> 21)) +
                                        o) |
                                    0) ^
                                    o ^
                                    n) +
                                    t[15] +
                                    530742520) |
                                0) <<
                                16) |
                                (a >>> 16)) +
                                i) |
                            0) ^
                            i ^
                            o) +
                            t[2] -
                            995338651) |
                        0) <<
                        23) |
                        (n >>> 9)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        (((i =
                            ((((i +=
                                ((n ^
                                    ((o =
                                        ((((o += ((a ^ (n | ~i)) + t[0] - 198630844) | 0) << 6) | (o >>> 26)) + n) |
                                        0) |
                                        ~a)) +
                                    t[7] +
                                    1126891415) |
                                0) <<
                                10) |
                                (i >>> 22)) +
                                o) |
                            0) ^
                            ((a = ((((a += ((o ^ (i | ~n)) + t[14] - 1416354905) | 0) << 15) | (a >>> 17)) + i) | 0) |
                                ~o)) +
                            t[5] -
                            57434055) |
                        0) <<
                        21) |
                        (n >>> 11)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        (((i =
                            ((((i +=
                                ((n ^
                                    ((o =
                                        ((((o += ((a ^ (n | ~i)) + t[12] + 1700485571) | 0) << 6) | (o >>> 26)) + n) |
                                        0) |
                                        ~a)) +
                                    t[3] -
                                    1894986606) |
                                0) <<
                                10) |
                                (i >>> 22)) +
                                o) |
                            0) ^
                            ((a = ((((a += ((o ^ (i | ~n)) + t[10] - 1051523) | 0) << 15) | (a >>> 17)) + i) | 0) |
                                ~o)) +
                            t[1] -
                            2054922799) |
                        0) <<
                        21) |
                        (n >>> 11)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        (((i =
                            ((((i +=
                                ((n ^
                                    ((o =
                                        ((((o += ((a ^ (n | ~i)) + t[8] + 1873313359) | 0) << 6) | (o >>> 26)) + n) |
                                        0) |
                                        ~a)) +
                                    t[15] -
                                    30611744) |
                                0) <<
                                10) |
                                (i >>> 22)) +
                                o) |
                            0) ^
                            ((a = ((((a += ((o ^ (i | ~n)) + t[6] - 1560198380) | 0) << 15) | (a >>> 17)) + i) | 0) |
                                ~o)) +
                            t[13] +
                            1309151649) |
                        0) <<
                        21) |
                        (n >>> 11)) +
                        a) |
                    0),
                (n =
                    ((((n +=
                        (((i =
                            ((((i +=
                                ((n ^
                                    ((o =
                                        ((((o += ((a ^ (n | ~i)) + t[4] - 145523070) | 0) << 6) | (o >>> 26)) + n) |
                                        0) |
                                        ~a)) +
                                    t[11] -
                                    1120210379) |
                                0) <<
                                10) |
                                (i >>> 22)) +
                                o) |
                            0) ^
                            ((a = ((((a += ((o ^ (i | ~n)) + t[2] + 718787259) | 0) << 15) | (a >>> 17)) + i) | 0) |
                                ~o)) +
                            t[9] -
                            343485551) |
                        0) <<
                        21) |
                        (n >>> 11)) +
                        a) |
                    0),
                (e[0] = (o + e[0]) | 0),
                (e[1] = (n + e[1]) | 0),
                (e[2] = (a + e[2]) | 0),
                (e[3] = (i + e[3]) | 0);
        }),
        (e.prototype.start = function () {
            return (this._dataLength = 0), (this._bufferLength = 0), this._state.set(e.stateIdentity), this;
        }),
        (e.prototype.appendStr = function (t) {
            var o,
                n,
                a = this._buffer8,
                i = this._buffer32,
                r = this._bufferLength;
            for (n = 0; n < t.length; n += 1) {
                if ((o = t.charCodeAt(n)) < 128) a[r++] = o;
                else if (o < 2048) (a[r++] = 192 + (o >>> 6)), (a[r++] = (63 & o) | 128);
                else if (o < 55296 || o > 56319)
                    (a[r++] = 224 + (o >>> 12)), (a[r++] = ((o >>> 6) & 63) | 128), (a[r++] = (63 & o) | 128);
                else {
                    if ((o = 1024 * (o - 55296) + (t.charCodeAt(++n) - 56320) + 65536) > 1114111)
                        throw new Error("Unicode standard supports code points up to U+10FFFF");
                    (a[r++] = 240 + (o >>> 18)),
                        (a[r++] = ((o >>> 12) & 63) | 128),
                        (a[r++] = ((o >>> 6) & 63) | 128),
                        (a[r++] = (63 & o) | 128);
                }
                r >= 64 && ((this._dataLength += 64), e._md5cycle(this._state, i), (r -= 64), (i[0] = i[16]));
            }
            return (this._bufferLength = r), this;
        }),
        (e.prototype.appendAsciiStr = function (t) {
            for (var o, n = this._buffer8, a = this._buffer32, i = this._bufferLength, r = 0; ; ) {
                for (o = Math.min(t.length - r, 64 - i); o--; ) n[i++] = t.charCodeAt(r++);
                if (i < 64) break;
                (this._dataLength += 64), e._md5cycle(this._state, a), (i = 0);
            }
            return (this._bufferLength = i), this;
        }),
        (e.prototype.appendByteArray = function (t) {
            for (var o, n = this._buffer8, a = this._buffer32, i = this._bufferLength, r = 0; ; ) {
                for (o = Math.min(t.length - r, 64 - i); o--; ) n[i++] = t[r++];
                if (i < 64) break;
                (this._dataLength += 64), e._md5cycle(this._state, a), (i = 0);
            }
            return (this._bufferLength = i), this;
        }),
        (e.prototype.getState = function () {
            var e = this._state;
            return {
                buffer: String.fromCharCode.apply(null, this._buffer8),
                buflen: this._bufferLength,
                length: this._dataLength,
                state: [e[0], e[1], e[2], e[3]]
            };
        }),
        (e.prototype.setState = function (e) {
            var t,
                o = e.buffer,
                n = e.state,
                a = this._state;
            for (
                this._dataLength = e.length,
                    this._bufferLength = e.buflen,
                    a[0] = n[0],
                    a[1] = n[1],
                    a[2] = n[2],
                    a[3] = n[3],
                    t = 0;
                t < o.length;
                t += 1
            )
                this._buffer8[t] = o.charCodeAt(t);
        }),
        (e.prototype.end = function (t) {
            void 0 === t && (t = !1);
            var o,
                n = this._bufferLength,
                a = this._buffer8,
                i = this._buffer32,
                r = 1 + (n >> 2);
            if (
                ((this._dataLength += n),
                (a[n] = 128),
                (a[n + 1] = a[n + 2] = a[n + 3] = 0),
                i.set(e.buffer32Identity.subarray(r), r),
                n > 55 && (e._md5cycle(this._state, i), i.set(e.buffer32Identity)),
                (o = 8 * this._dataLength) <= 4294967295)
            )
                i[14] = o;
            else {
                var s = o.toString(16).match(/(.*?)(.{0,8})$/);
                if (null === s) return;
                var l = parseInt(s[2], 16),
                    c = parseInt(s[1], 16) || 0;
                (i[14] = l), (i[15] = c);
            }
            return e._md5cycle(this._state, i), t ? this._state : e._hex(this._state);
        }),
        (e.stateIdentity = new Int32Array([1732584193, -271733879, -1732584194, 271733878])),
        (e.buffer32Identity = new Int32Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])),
        (e.hexChars = "0123456789abcdef"),
        (e.hexOut = []),
        (e.onePassHasher = new e()),
        e
    );
})();
(o.Md5 = n), "5d41402abc4b2a76b9719d911017c592" !== n.hashStr("hello") && console.error("Md5 self test failed.");
